package com.dlts.freemarker.model;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * 公共分页类
 */
@Data
@ApiModel(description = "公共分页请求参数")
public class PageDTO {

    @ApiModelProperty(value = "当前页码", example = "1", required = true)
    @Min(value = 1, message = "页码至少为 {value}")
    @NotNull(message = "页码不能为空")
    private long current = 1;

    @ApiModelProperty(value = "每页条数", example = "10", required = true)
    @Min(value = 1, message = "每页显示条数最小为 {value}")
    @NotNull(message = "页码不能为空")
    private long size = 10;
}
